//
// Created by sai on 2019/4/7.
//

#ifndef POLYNOMIAL_OPERATION_POLYNOMIALOPERATOR_H
#define POLYNOMIAL_OPERATION_POLYNOMIALOPERATOR_H
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>

struct PolyItem;
struct Node;
struct PolyList;
typedef struct PolyItem Type;
typedef struct Node *Position;
typedef struct PolyList *PolyList;

PolyList makeEmpty(PolyList list, char *name);

bool IsEmpty(PolyList list);

bool IsLast(Position pos);

Position FindNode(Type data, PolyList list);

Position FindNodePrev(Type data, PolyList list);

bool InsertNode(Type data, PolyList list, Position pos);

bool DeleteNode(Type data, PolyList list);

bool DeleteList(PolyList list);

void Append(Type data, PolyList list);

void InputPolynomialData(int Coefficient, int Exponent, PolyList list);

void PrintPolynomial(PolyList list);

struct PolyItem {
    int Coefficient;
    int Exponent;
};
struct Node {
    Type data;
    Position next;
};
struct PolyList {
    Position head;
    Position last;
    int Len;
    char *name;
};
#endif //POLYNOMIAL_OPERATION_POLYNOMIALOPERATOR_H
